<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script src="../static/elementui/index.css"></script>
    <script src="../static/elementui/index.js"></script>
    <script src="../static/js/vue.js"></script>
    <script src="../static/js/axios.js"></script>
    <script src="../static/js/util.js"></script>
    <!-- 引入ElementUI样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">

    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <!-- 引入ElementUI组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>

</head>

<body>
<div id="app">
    <a href="add.html">添加</a>
    <template>
        <el-table :data="list" border style="width: 100%">
            <el-table-column prop="name" label="姓名" width="180"></el-table-column>
            <el-table-column prop="age" label="年龄" width="180"></el-table-column>
            <el-table-column prop="sex" label="性别" width="180"></el-table-column>
            <el-table-column prop="createtime" label="日期" width="180"></el-table-column>
        </el-table>
    </template>

</div>
<script>
    new Vue({
        el: "#app",
        data: {
            list: []
        },
        created() {
            this.findAll()
        },
        methods: {
            findAll() {
                axios.get("http://localhost:8080/emp/findALL").then(
                    res => {
                        this.list = res.data
                    }
                )
            }
        }
    })
</script>

</body>

</html>